<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

    <script>
        let a = 23;
        let b = 34;
        let c = 45;

        //单行处理
        // let a = 23,b = 34,c = 45;


        let arr = [23,34,45];
        let arr1 = arr[0];
        let arr2 = arr[1];
        let arr3 = arr[2];


        // let 标识符 = 值;
        
        //解构 let 一组标识符 =  一组值
        let [a1,b1,c1] = [23,34,45];
        console.log(a1,b1,c1);

        let [a11,b11,c11] = [23,34,45,56,67,78,89,123];
        console.log(a11,b11,c11);

        let [,,,,d1] = [23,34,45,56,67,78,89,123];;
        console.log(d1);

        let [,,h,...d11] = [23,34,45,56,67,78,89,123];;
        console.log(d11,h);

        let [x,y=0] = [23];
        console.log(x,y);

        let {t,bs} = {as:"aaa",bs:"bbb"};
        console.log(t,bs);

        for(let s of 'abcdefghjfldsa'){
            console.log(s);
        }

        // foreach forof  取字符串里面的每一个字符，或者数据里面第一个元素
        for(let s of [12,22,32,41]){
            console.log(s);
        }

        let arr21 = [1,2,3,4];
        for(let s in arr21){
            console.log(arr21[s]);
        }
   
    </script>

</body>
</html>